<template>
  <div class="alert-box">
    <div class="mask-div" v-if="alertMessage.is_show">
      <div class="mask-bg" @click="alertMessage.is_show = false"></div>
      <div class="content">
        <p class="title" v-if="alertMessage.title">{{alertMessage.title}}</p>
        <p class="tip">{{alertMessage.tip}}</p>
        <span class="btn" @click="clickBtn">{{alertMessage.btn}}</span>
      </div>
    </div>
  </div>
</template>

<script>

  export default {
    components: {
    },
    props: {
      'alertMessage': {
        type: Object,
        required: true,
      },
    },
    data () {
      return {
        is_show: false
      }
    },
    created () {
    },
    methods: {
      clickBtn () {
        this.alertMessage.is_show = false
        this.$router.push(this.alertMessage.path)
      },
    }
  }
</script>

<style lang="stylus" scoped>
  .alert-box
    .content
      width 78%
      left 11%
      background-color #fff
      border-radius .3rem
      text-align center
      top 15.4rem
      padding-top 2.2rem
      .title
        font-size 1.7rem
        line-height 1.7rem
        height 1.7rem
        color #333
        font-weight 500
        margin-bottom 2.5rem
      .tip
        font-size 1.3rem
        line-height 2rem
      .btn
        height 5rem
        line-height 5rem
        display block
        width 100%
        color #152D6F
        font-size 1.5rem
        text-align center
        border-top 1px solid #e6e6e6
        margin-top 2.5rem
</style>
